package com.zhiyin.seal.controller;

import com.zhiyin.seal.entity.bo.FeedbackBo;
import com.zhiyin.seal.entity.dto.FeedbackDTO;
import com.zhiyin.seal.entity.dto.ResponseDTO;
import com.zhiyin.seal.service.FeedbackService;
import com.zhiyin.seal.util.BeanUtil;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.*;

/**
 * 问题反馈控制器
 */
@RestController
@RequestMapping("/feedback")
public class FeedbackController {
    @Autowired
    private FeedbackService feedbackService;

    @RequestMapping(value = "/save",method = RequestMethod.POST)
    public ResponseDTO<Boolean> save(@RequestBody FeedbackDTO feedback){
        return ResponseDTO.succData(feedbackService.save(BeanUtil.copy(feedback,FeedbackBo.class)));
    }
}